<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>
<%@ include file="../init_include.jsp" %>
<%
	int check_rst=Permission.accept(dbi,session,request,"sysop","tree","catid","000001000"); 	
	if (check_rst!=Permission.CHECK_RST_SUCCESS) {
		dbi.closeAll();
		if (check_rst==Permission.CHECK_RST_DENY)
			response.sendRedirect("../deny.html");
		else
			response.sendRedirect("../index.jsp");
		return;		
	}
	String oldname="",newname="";
	if(request.getParameter("oldname")!=null)
		oldname=request.getParameter("oldname");
	if(request.getParameter("newname")!=null)
		newname=request.getParameter("newname");
	String info="";
	if(Sysop.changeName(dbi,oldname,newname))	{
		out.print(Language.getNameByCode("sys.sysop.change_success","Change username successful!"));
		info="closewindow(0)";
	} else 
		info="ErrorAlert('"+Language.getNameByCode("sys.sysop.userexists","User is already exists,please change another user!")+"')";
%>		
<script Language="JavaScript" src="../script/Ion_Show.js"></script> 
<script language="javascript">
	<%=info%>;
</script>	
<%@ include file="../init_free.jsp" %>